package main

import "fmt"

type SpecialString string

var whatIsThis SpecialString = "hello"

func TypeSwitch() {
	testFunc := func(any interface{}) {
		switch t := any.(type) {
		case int:
			fmt.Printf("类型 int %T\n", t)
		case string:
			fmt.Printf("类型 string %T\n", t)
		case bool:
			fmt.Printf("类型 bool %T\n", t)
		case SpecialString:
			fmt.Printf("类型 SpecialString %T\n", t)
		default:
			fmt.Printf("未预期的类型 %T", t)
		}
	}

	testFunc(whatIsThis)
}

func main() {
	TypeSwitch()
}
